package com.sinodata.ns.cell;

import jt.classic.system.AbstractIBigObject;

import java.util.List;
import java.util.Map;


/**
 * 设计单元内容
 *
 * @author mido
 *
 */
public class CellInfo extends AbstractIBigObject {
    private String unit;
    private String type;
    private String area;
    private String time;
    private String userId;
    private String userName;
    private List list;
    private String lon;
    private String lat;

    public CellInfo() {
    }

    /**
     * 标段列表
     * @return List
     */
    public List ibd() {
        return this.list;
    }

    /**
     * 标段信息
     * @param id 标段ID
     * @return CellBDInfo
     */
    public CellBDInfo ibd(String id) {
        CellBDInfo cbinfo = null;

        if ((this.list != null) && !this.list.isEmpty()) {
            for (int i = 0; i < this.list.size(); i++) {
                cbinfo = (CellBDInfo) this.list.get(i);

                if (cbinfo.id().equals(id)) {
                    break;
                }
            }
        }

        return cbinfo;
    }

    /**
     * 单位
     * @return String
     */
    public String iunit() {
        return this.unit;
    }
    
    /**
     * 坐标经度
     * @return String
     */
    public String ilon(){
    	return this.lon;
    }
    
    /**
     * 坐标纬度
     * @return String
     */
    public String ilat(){
    	return this.lat;
    }

    /**
     * 设计单元类型
     * @return String
     */
    public String itype() {
        return this.type;
    }

    /**
     * 所属区域
     * @return String
     */
    public String iarea() {
        return this.area;
    }

    /**
     * 定义时间
     * @return String
     */
    public String itime() {
        return this.time;
    }

    /**
     * 定义人ID
     * @return String
     */
    public String iuserid() {
        return this.userId;
    }

    /**
     * 定义人姓名
     * @return String
     */
    public String iusername() {
        return this.userName;
    }

    public void reload(Map map) {
        if (map != null) {
            this.info = map;

            this.bigoid = (String) this.info.get("C_ID");
            this.userId = (String) this.info.get("USERID");
            this.userName = (String) this.info.get("USERNAME");
            this.bigoname = (String) this.info.get("C_NAME");
            this.unit = (String) this.info.get("C_UNIT");
            this.type = (String) this.info.get("C_TYPE");
            this.area = (String) this.info.get("C_AREA");
            this.time = (String) this.info.get("C_TIME");
            this.list = (List)this.info.get("CELLBD");
            this.lat = (String)this.info.get("C_LAT");
            this.lon = (String)this.info.get("C_LON");
        }
    }
}
